package goods

import "gorm.io/gorm"

type Goods struct {
	gorm.Model
	GoodsId      int64  `gorm:"type:int(11);not null;comment:商品id"`
	GoodsName    string `gorm:"type:varchar(50);not null;comment:商品名称"`
	GoodsPrice   int64  `gorm:"type:int(64);not null;comment:商品价格"`
	GoodsNum     int64  `gorm:"type:int(11);comment:商品数量"`
	GoodsAddress string `gorm:"type:varchar(50);not null;comment:商品地址"`
}

func (u *Goods) Creates() error {
	return DB.Create(&u).Error
}
func (u *Goods) List() error {
	return DB.Where("goods_id=?", u.GoodsId).Find(u).Error
}
